// CMF.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "CMF.h"
#include "intf_cmf_man.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// The one and only application object

CWinApp theApp;

using namespace std;

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
	int nRetCode = 0;

	// initialize MFC and print and error on failure
	if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
	{
		// TODO: change error code to suit your needs
		cerr << _T("Fatal Error: MFC initialization failed") << endl;
		nRetCode = 1;
	}
	else
	{
		// TODO: code your application's behavior here.
		int i, n1, n2;
		tmf_id_t id1, id2;
		char TDATA1[128 * 1024] = ";100;36.5;160;39.5";
		char TDATA2[128 * 1024] = ";100;36.5;160;39.5";
		tmpr_data_t pdata1[100];
		tmpr_data_t pdata2[100];

		id1.id = 1;
		id2.id = 2;

		n1 = gentmpr(TDATA1, strlen(TDATA1), 0, 0, pdata1);
		cmf_man_save_tmpr_data(&id1, n1, pdata1);
		n2 = cmf_man_get_tmpr_data(&id1, 0, 0, pdata2);
		printf("%d\n", n2);
		for(i = 0; i < n2; i ++) {
			printf("%f", pdata2[i].tmpr);
			printf("\t");
			printf("%d", pdata2[i].tm);
			printf("\n");
		}
	}

	return nRetCode;
}


